The present invention relates to a program making method, and more particularly to a program making method suitable for programming in a computer which has a bit map display device capable of displaying graphics or figures.
Conventionally, a method of using diagrams such as flow charts have been used as a method of visualizing a program to improve the efficiency of making the program. Any flow chart facilitates the comprehension of the program by two-dimensionally illustrating a control flow such as a conditional branch or iteration loop in the program but data handled by the program has not been visualized.
On the other hand, a method of facilitating the making of a program by use of icons visually representing data handled by the program or procedures is disclosed in IEEE Software, Vol. 4, No. 1, (1987) pp. 29-39 (herein-after referred to as reference 1).
As one of such methods called visual programming, one of the present inventors has proposed, in JP-A-01-121935 (hereinafter referred to as reference 2) or the corresponding U.S. Ser. No. 266,079 filed on November, 1988, now U.S. Pat. No. 5,287,449, a method of making a program in such a manner that data concerning an object to be processed by the program is two-dimensionally displayed as an icon on a display device and the instruction of data manipulation is made to the icon. In the proposed method, instructions, including a data selection instruction for displaying data satisfying a given selection condition as an icon, and a data manipulation instruction for manipulating the selected data to display the result again as an icon, are provided, and a variety of programs can be made while observing the structure of data as an object on the display device.
As another method of improving the work efficiency of programming, a programming technique called object orientation is widely used. In this technique, an object including a set of a data structure and a procedure of manipulation thereof is defined and the programming is made by describing the behavior of such an object. A name specifying data in the data structure is called a slot, the data corresponding to the slot is called a slot value and the procedure defined for the object is called a method.
A feature of the programming technique based on object orientation lies in a restriction imposed on an object, that is, the restriction that the change of a slot value of a certain object can be made by only a method defined in the same object. Owing to this restriction, a risk of a programmer carelessly changing data is reduced and the modulization of a program can be promoted.
An object can be handled in a personified form since it possesses both data and a procedure and individual objects (called object instances) carry on their works while communicating messages with each other.
"Agents and the HP New Wave Application Program Interface", Hewlett-Packard Journal, pp. 32-37, August, 1989 (hereinafter referred to as reference 3) discloses a system in which the fixtures (such as file, printer and so forth) placed in an office environment and persons working in the office are abstracted as objects and which the objects are displayed as icons on a bit map display device to construct a pseudo in-computer office environment. In this system, an operator gives human icons representing persons work messages as commands together with icons of another object used for work. Since the work progresses while the human object serves as an object, the operator encounters a feeling that the work is requested upon a (confidential) secretary in the office.
The system according to the reference 2 facilitates the comprehension of a program by two-dimensionally visualizing the structure of data handled by the program. However, the data is restricted to numerical data such as numeric values or an array of numeric values. Though the field of application of such a program handing the numeric data is wide, there are may fields where other important problems exist. For example, when considering a program for solving a problem concerning an artificial intelligence, relatively concrete and visual data are essentially handled in many cases. Consider as a simple one of such examples the problem of Hanoi tower problem, which is often used as a teaching material of programming.
The problem of Hanoi tower is as follows. Three towers capable of carrying saucers thereon are prepared, as shown in FIG. 8A. In an initial state, a plurality of saucers are placed on only one of the three towers in the order of sizes from the larger one to the smaller one. A problem to be solved is to transfer all of the saucers from a certain tower to another tower under the condition that on a certain saucer should not be placed a saucer larger than that. In the case of this problem, objects to be operated or manipulated by a program are data having concrete images such as the saucers and the towers. In the conventional programming language based on symbol string, data such as saucers to towers is converted into abstractive symbols to make a program which solves this problem. For example, FIG. 18B shows a program for solving the Hanoi tower problem by means of a LISP language which is a programming language for artificial intelligence. FIG. 18C shows the result of execution of the program shown in FIG. 18B. In the program shown in FIG. 18B, a tower having, for example, three saucers is realized as an example of numeric data such as [3, 2, 1]. According to this method, the Hanoi tower problem can be solved by the technique of the above reference 2. However, such a program as shown in FIG. 18B is far different from images as shown in FIG. 18A and this is a factor which makes the work of programming difficult for ordinary non-specialists of a computer.
There are many programs handling artificially intelligent problems other than the Hanoi tower problem. For example, one of such programs handles visual data to determine of the shortest path on a map. The great of control programs for equipments issue operation commands to respective parts of the equipment. In such cases, objects to be handled are concrete materials such as parts, that is, visual data. In the above-mentioned references, no consideration is paid to the provision of a method of making an intelligible program in which such objects having concrete graphic or figure images in essence are handled as they are the figure images.
Also, the above references have a lack of consideration about allowing a programmer his or her understanding of the state of progression of manipulation for the objects having concrete images by visualizing the progression. Namely, in the above references, since a change in state in the course of manipulation if not displayed though the result of manipulation is displayed, there is a problem that it is hard to comprehend which of objects or which of elements of an object changes in what manner in the cause of the manipulation. For example, in the problem of Hanoi tower, the operation for transfer of a saucer causes a person to image the gradual movement of the saucer in a space. Also, an example of equipment control causes a person to image the movement (or translation) or rotation of parts with the actuation of a certain mechanism. In the above references, such visual elements or change are not demonstrated to the programmer.
In the reference 3, though an object is displayed as an icon, an image of the icon only gives an intuitive association of a function of the object. Accordingly, there is a problem that it is not possible to visually confirm the process and/or result of execution of an object method.